Observaciones:
La cantidad de canales del shape del proyecto no coincide con la cantidad de channels del archivo de salida del SWAT. En este ultimo tengo 95 y en el primero más de 100 canales.
Por lo tanto, hay canales que quedan sin identificar su subcuenca.
Dentro de los canales que salen en el SWAT, algunos no se encuentran tampoco en los canales del proyecto.
En la imagen, donde los channels estan en azul y la subcuenca en negro, se nota que no están incluidos todos los channels.
Canales y Subcuencas del archivo hru2.shp
Notar que el nivel permitido por dinama es de hasta 0.25 mg/L en P y 10 mg/L en N. A continuación los resultados por canal y subcuenca.
dt1<-
env_out_sub %>% group_by(channel, Subbasin) %>% summarise(P_mean=mean(P_Concentration), N_mean=mean(N_Concentration), flo_out_mean=mean(flo_out)) %>%
arrange(desc(P_mean)); dt1
## # A tibble: 95 x 5
## # Groups: channel [95]
## channel Subbasin P_mean N_mean flo_out_mean
## <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 95 NA 227070. 2201. 2.66
## 2 86 3 59.1 1.45 3.32
## 3 84 NA 44.6 9.16 3.47
## 4 91 NA 25.2 0.296 2.53
## 5 93 NA 1.65 0.274 2.44
## 6 92 2 0.241 0.409 2.52
## 7 82 NA 0.227 0.0763 5.47
## 8 51 4 0.182 7.11 71.1
## 9 80 8 0.169 0.260 3.97
## 10 11 12 0.0658 0.690 1172.
## # ... with 85 more rows
env_out_sub %>% group_by(channel, Subbasin) %>% summarise(P_mean=mean(P_Concentration), N_mean=mean(N_Concentration), flo_out_mean=mean(flo_out)) %>%
arrange(desc(N_mean))
## # A tibble: 95 x 5
## # Groups: channel [95]
## channel Subbasin P_mean N_mean flo_out_mean
## <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 95 NA 227070. 2201. 2.66
## 2 40 10 0.0191 10.6 140.
## 3 84 NA 44.6 9.16 3.47
## 4 48 10 0.0151 9.03 96.0
## 5 51 4 0.182 7.11 71.1
## 6 44 NA 0.0272 6.60 176.
## 7 20 NA 0.0198 4.61 438.
## 8 45 NA 0.0190 4.06 112.
## 9 57 NA 0.0157 3.49 49.1
## 10 19 11 0.0141 3.45 449.
## # ... with 85 more rows
env_out_sub %>% group_by(channel, Subbasin) %>% summarise(P_mean=mean(P_Concentration), N_mean=mean(N_Concentration), flo_out_mean=mean(flo_out)) %>%
arrange(desc(flo_out_mean))
## # A tibble: 95 x 5
## # Groups: channel [95]
## channel Subbasin P_mean N_mean flo_out_mean
## <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 1 13 0.000236 0.0918 1372.
## 2 2 13 0.000457 0.154 1355.
## 3 3 13 0.000544 0.168 1353.
## 4 4 NA 0.000555 0.226 1293.
## 5 5 13 0.000204 0.0698 1289.
## 6 6 NA 0.000199 0.0677 1282.
## 7 7 NA 0.00180 0.0987 1274.
## 8 8 12 0.00127 0.0846 1227.
## 9 9 12 0.000869 0.0767 1201.
## 10 10 NA 0.00133 0.0790 1182.
## # ... with 85 more rows
env_out_sub %>% group_by(channel, Subbasin) %>% summarise(P_mean=mean(P_Concentration), N_mean=mean(N_Concentration), flo_out_mean=mean(flo_out)) %>%
arrange(flo_out_mean)
## # A tibble: 95 x 5
## # Groups: channel [95]
## channel Subbasin P_mean N_mean flo_out_mean
## <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 94 8 0.000704 0.146 2.10
## 2 90 NA 0.000381 0.166 2.26
## 3 93 NA 1.65 0.274 2.44
## 4 92 2 0.241 0.409 2.52
## 5 91 NA 25.2 0.296 2.53
## 6 95 NA 227070. 2201. 2.66
## 7 86 3 59.1 1.45 3.32
## 8 84 NA 44.6 9.16 3.47
## 9 89 8 0.000509 0.121 3.87
## 10 80 8 0.169 0.260 3.97
## # ... with 85 more rows
plotly::ggplotly(
ggplot(data=dt1 %>% filter(channel!=95), aes(x=channel, y=N_mean, fill=Subbasin)) +
geom_bar(stat="identity")+
coord_flip()
)
plotly::ggplotly(
ggplot(data=dt1 %>% filter(channel!=95), aes(x=channel, y=P_mean, fill=Subbasin)) +
geom_bar(stat="identity")+
coord_flip()
)
plotly::ggplotly(
ggplot(data=dt1 %>% filter(P_mean<10), aes(x=channel, y=P_mean, fill=Subbasin)) +
geom_bar(stat="identity")+
coord_flip()
)
plotly::ggplotly(
ggplot(data=dt1, aes(x=channel, y=flo_out_mean, fill=Subbasin)) +
geom_bar(stat="identity")+
coord_flip()
)
Los resultados solo por subcuenca son los siguientes:
#sub promedio N, P, Flo por subbasin ----
dt2<- env_out_sub %>% group_by(Subbasin) %>% summarise(P_mean=mean(P_Concentration), N_mean=mean(N_Concentration),
flo_out_mean=mean(flo_out)) %>%
arrange(desc(P_mean)) %>%
filter(!is.na(Subbasin)) %>%
mutate(indice_N=N_mean/max(N_mean),
indice_P=P_mean/max(P_mean),
indice_flo=flo_out_mean/max(flo_out_mean)); dt2
## # A tibble: 9 x 7
## Subbasin P_mean N_mean flo_out_mean indice_N indice_P indice_flo
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 3 59.1 1.45 3.32 0.367 1 0.00247
## 2 2 0.241 0.409 2.52 0.103 0.00407 0.00188
## 3 8 0.0293 0.147 5.41 0.0370 0.000496 0.00403
## 4 4 0.0282 1.71 37.1 0.432 0.000477 0.0276
## 5 12 0.0226 0.284 1200. 0.0717 0.000383 0.894
## 6 10 0.00700 3.96 137. 1 0.000118 0.102
## 7 11 0.00343 0.752 434. 0.190 0.0000581 0.324
## 8 13 0.000360 0.121 1342. 0.0305 0.00000610 1
## 9 9 0.000185 0.0841 6.07 0.0212 0.00000314 0.00452
dt3<- env_out_sub %>% group_by(yr) %>% summarise(P_mean=mean(P_Concentration), N_mean=mean(N_Concentration),
flo_out_mean=mean(flo_out)) %>%
mutate(indice_N=N_mean/max(N_mean),
indice_P=P_mean/max(P_mean),
indice_flo=flo_out_mean/max(flo_out_mean)) %>%
mutate(yr=as.numeric(yr)) %>% arrange(yr); dt3
## # A tibble: 20 x 7
## yr P_mean N_mean flo_out_mean indice_N indice_P indice_flo
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2000 0.000481 0.104 392. 0.000223 0.0000000101 0.724
## 2 2001 0.000311 0.0780 454. 0.000168 0.00000000651 0.839
## 3 2002 0.000259 0.130 274. 0.000279 0.00000000541 0.505
## 4 2003 0.000316 0.0700 319. 0.000151 0.00000000662 0.590
## 5 2004 0.000359 0.160 148. 0.000345 0.00000000751 0.274
## 6 2005 0.000307 0.0961 231. 0.000207 0.00000000642 0.426
## 7 2006 0.000230 0.103 224. 0.000222 0.00000000482 0.413
## 8 2007 0.000357 0.150 464. 0.000323 0.00000000747 0.856
## 9 2008 21.7 1.21 9.86 0.00260 0.000454 0.0182
## 10 2009 47805. 465. 329. 1 1 0.608
## 11 2010 0.000363 0.122 323. 0.000262 0.00000000760 0.597
## 12 2011 0.000341 0.0761 76.3 0.000164 0.00000000714 0.141
## 13 2012 0.0446 0.0840 326. 0.000181 0.000000932 0.603
## 14 2013 0.0745 12.7 105. 0.0273 0.00000156 0.194
## 15 2014 0.000266 0.105 541. 0.000227 0.00000000557 1
## 16 2015 0.000349 0.0487 158. 0.000105 0.00000000729 0.292
## 17 2016 0.000404 0.118 286. 0.000254 0.00000000846 0.528
## 18 2017 0.000418 0.0559 259. 0.000120 0.00000000875 0.479
## 19 2018 5.36 0.121 230. 0.000261 0.000112 0.425
## 20 2019 0.000492 0.0528 330. 0.000114 0.0000000103 0.609
plotly::ggplotly(
ggplot(data=dt2, aes(x=Subbasin, y=N_mean, fill=Subbasin)) +
geom_bar(stat="identity")+
coord_flip()
)
plotly::ggplotly(
ggplot(data=dt2, aes(x=Subbasin, y=P_mean, fill=Subbasin)) +
geom_bar(stat="identity")+
coord_flip()
)
plotly::ggplotly(
ggplot(data=dt2 %>% filter(P_mean<20), aes(x=Subbasin, y=P_mean, fill=Subbasin)) +
geom_bar(stat="identity")+
coord_flip()
)
plotly::ggplotly(
ggplot(data=dt2, aes(x=Subbasin, y=flo_out_mean, fill=Subbasin)) +
geom_bar(stat="identity")+
coord_flip()
)
plotly::ggplotly(
ggplot(data=dt1 %>% filter(!is.na(Subbasin)), aes(x=Subbasin, y=N_mean)) +
geom_boxplot()
)
plotly::ggplotly(
ggplot(data=dt1 %>% filter(!is.na(Subbasin)) %>% filter(P_mean<20), aes(x=Subbasin, y=P_mean)) +
geom_boxplot()
)
plotly::ggplotly(
ggplot(data=env_out_sub %>% filter(P_Concentration<10), aes(x=yr, y=P_Concentration)) +
geom_boxplot()
)
plotly::ggplotly(
ggplot(data=env_out_sub %>% filter(N_Concentration<100), aes(x=yr, y=N_Concentration)) +
geom_boxplot()
)
plotly::ggplotly(
ggplot(data=env_out_sub , aes(x=yr, y=flo_out)) +
geom_boxplot()
)
plotly::ggplotly(
ggplot(data=dt1 %>% filter(!is.na(Subbasin)) , aes(x=Subbasin, y=flo_out_mean)) +
geom_boxplot()
)
irr_yr<-
irr_yr %>% plyr::join(hru_info, by="hru") %>% plyr::join(sub_hru, by="hru")
irr1<-
irr_yr %>% group_by(Subbasin) %>%
summarise(irr=sum(irr_sum)) %>% arrange(desc(irr));irr1
## # A tibble: 14 x 2
## Subbasin irr
## <dbl> <dbl>
## 1 NA 457515
## 2 8 183015
## 3 6 181845
## 4 10 154260
## 5 13 149355
## 6 2 135810
## 7 4 135652.
## 8 9 123390
## 9 5 111780
## 10 1 75555
## 11 12 61830
## 12 11 59040
## 13 7 56992.
## 14 3 35258.
plotly::ggplotly(
ggplot(data=irr_yr %>% filter(!is.na(Subbasin)) , aes(x=Subbasin, y=irr_sum)) +
geom_boxplot()
)
irr2<-
irr_yr %>% group_by(lu_mgt) %>%
summarise(irr=sum(irr_sum)); irr2
## # A tibble: 2 x 2
## lu_mgt irr
## <chr> <dbl>
## 1 agrc3_lum 935190
## 2 agrc4_lum 986108.
plotly::ggplotly(
ggplot(data=irr_yr , aes(x=lu_mgt, y=irr_sum)) +
geom_boxplot()
)
irr3<-
irr_yr %>% group_by(yr) %>%
summarise(irr=sum(irr_sum)); irr3
## # A tibble: 20 x 2
## yr irr
## <chr> <dbl>
## 1 2000 197662.
## 2 2001 43402.
## 3 2002 43470
## 4 2003 270
## 5 2004 51210
## 6 2005 108945
## 7 2006 67230
## 8 2007 77130
## 9 2008 214695
## 10 2009 142718.
## 11 2010 72810
## 12 2011 221918.
## 13 2012 166275
## 14 2013 54292.
## 15 2014 2272.
## 16 2015 88650
## 17 2016 63202.
## 18 2017 58792.
## 19 2018 191992.
## 20 2019 54360
plotly::ggplotly(
ggplot(data=irr_yr , aes(x=yr, y=irr_sum)) +
geom_boxplot()
)
irr4<-
irr_yr %>% group_by(Subbasin, lu_mgt) %>%
summarise(irr=sum(irr_sum)); irr4
## # A tibble: 28 x 3
## # Groups: Subbasin [14]
## Subbasin lu_mgt irr
## <dbl> <chr> <dbl>
## 1 1 agrc3_lum 36472.
## 2 1 agrc4_lum 39082.
## 3 2 agrc3_lum 66960
## 4 2 agrc4_lum 68850
## 5 3 agrc3_lum 16065
## 6 3 agrc4_lum 19192.
## 7 4 agrc3_lum 66262.
## 8 4 agrc4_lum 69390
## 9 5 agrc3_lum 53505
## 10 5 agrc4_lum 58275
## # ... with 18 more rows
plotly::ggplotly(
ggplot(data=irr_yr, aes(x=Subbasin, y=irr_sum, fill=lu_mgt)) +
geom_bar(stat="identity")
)